package 线程第一天.实现线程第三种方式;

import java.util.concurrent.FutureTask;

public class Test {
    public static void main(String[] args) throws Exception{
        MyCallable myCallable = new MyCallable();
        FutureTask<String> futureTask = new FutureTask<>(myCallable);
        Thread thread = new Thread(futureTask);
        thread.start();
        String s = futureTask.get();
        System.out.println("--------");
        System.out.println(s);
    }
}
